import { Column, DeleteDateColumn, Entity, PrimaryGeneratedColumn } from "typeorm"

@Entity({ name: "program", engine: "InnoDB" })
export class ProgramEntity {
  // index
  @PrimaryGeneratedColumn({ type: "int" })
  id: number

  // application name
  @Column({ type: "varchar" })
  name: string

  // price
  @Column({ type: "decimal", default: 0, precision: 10, scale: 2 })
  price: string

  // application status, 1 is opened , 0 is closed
  @Column({ type: "tinyint" })
  status: number

  // cycle
  @Column({ type: "int" })
  cycle: number

  // create date
  @Column({ type: "date" })
  create_date: string

  // download site
  @Column({ type: "varchar" })
  download: string

  // application description
  @Column({ type: "varchar" })
  description: string

  // cover image
  @Column({ type: "varchar" })
  img: string

  // soft deletion tag
  @DeleteDateColumn({ nullable: true })
  deleteAt: Date
}
